<style>
.layui-input-block{
margin-left:120px;
}
</style>
<form class="layui-form" action="" id="orderEditForm" style="position: absolute;">
<div class="layui-row"  style="margin-top:10px;">
	  
	  <div class="layui-form-item">
		      <label class="layui-form-label" style="width:100px">公司</label>
		      <div class="layui-input-block" style="width:200px">
				<select name="companyId" id="companyId" lay-verify="required">
					<option th:each="ec:${actCenterCompanyMap}" th:value="${ec.code}" th:text="${ec.value}" th:selected="${ec.code}==${companyId}"></option>
				</select>
		      </div>
		    </div>
	  
	 <div class="layui-form-item">
		    <label class="layui-form-label" style="width:120px;">角色名称</label>
		    <div class="layui-input-block" style="width:200px;">
		         <input type="text" name="name" class="layui-input" lay-verify="required"/>
		    </div>
	   </div>

  	 
	  <div class="layui-form-item">
		    <label class="layui-form-label" style="width:120px;">角色状态</label>
		    <div class="layui-input-block" style="width:200px;" >
				<select name="status" id="status" lay-verify="required">
					<option value="">请选择状态</option>
					<option th:each="ec:${commonStatus2List}" th:value="${ec.code}" th:text="${ec.value}"></option>
				</select>
		    </div>
	   </div>
  	
	  <div class="layui-form-item">
	    <label class="layui-form-label" style="width:120px;" >备注</label>
	    <div class="layui-input-block" style="width:200px;">
		    <textarea name="remark" class="layui-textarea" style="min-height:0px;"></textarea>
	    </div>
	   </div>
</div>
  
 <div class="layui-row" style="margin-top:20px;">
    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12" style="text-align:center;margin-left:35px;">
          <button class="layui-btn" lay-submit="" lay-filter="formSubmit" >提交</button>
      	<button type="button" class="layui-btn layui-btn-primary" id="closeBtn">关闭</button>
    </div>
  </div>
    <div id="menuContent" class="menuContent layui-bg-gray" style="display:none; position: absolute;">
    <ul id="treeDemo" class="ztree" style="margin-top:0; width:160px;"></ul>
    </div>
</form>

<script>

//start use
layui.use('form', function(){
	
	  var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
	  //……
	  //但是，如果你的HTML是动态生成的，自动渲染就会失效
	  //因此你需要在相应的地方，执行下述方法来手动渲染，跟这类似的还有 element.init();
	  form.render();
	//监听表单提交
	form.on('submit(formSubmit)',function(data) {
		$.ajax({url:'/sys/role/table/add',
			data:$("#orderEditForm").serializeJson(),
			type:"get",
			contentType:"application/json",
			success:function(data){
				if(data.code==200){
					layer.msg("数据保存成功！");
					layer.closeAll();
				}else{
					layer.msg(data.message);
				}
			}});
		return false;
	});
	$('#closeBtn').click(function() {
		layer.close(editdialogindex);
	});
});
//end use
</script>